[#2441] Fixed Acquia DB download to skip auth header on S3 redirect.#2465
[#2441] Fixed Acquia DB download to skip auth header on S3 redirect.#2465AlexSkrypnyk merged 1 commit intomainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughThe Acquia backup URL discovery logic is refactored to capture HTTP redirect targets directly via Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Code coverage (threshold: 90%) Per-class coverage |
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
|
Code coverage (threshold: 90%) Per-class coverage |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2465 +/- ##
==========================================
- Coverage 79.88% 79.45% -0.44%
==========================================
Files 128 121 -7
Lines 6861 6697 -164
Branches 47 3 -44
==========================================
- Hits 5481 5321 -160
+ Misses 1380 1376 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Closes #2441
Summary
Fixed two bugs in
scripts/vortex/download-db-acquia.shthat caused Acquia DB downloads to fail.The Acquia API
actions/downloadendpoint returns a 302 redirect to a presigned S3 URL. The previous implementation followed the redirect with-L, which could send theAuthorization: Bearerheader to S3 - S3 presigned URLs reject requests that carry extra auth headers, causing the download to return an error body instead of the archive. The fix captures only the redirect URL (without following it) and then makes a separate, auth-free curl call to S3.Additionally, error branches that deleted partially-downloaded or corrupt files with
rm -fwere changed to leave those files in place so they can be inspected when something goes wrong.Changes
scripts/vortex/download-db-acquia.shcurl --progress-bar -L ... | extract_json_value "url"withcurl -s -o /dev/null -w "%{redirect_url}" ...to capture the S3 redirect URL without following it and without forwarding theAuthorizationheader. The JSON-parsing branch was removed because the API only ever responds with a redirect, not a JSON body.rm -fcalls from error branches (empty/missing download, invalid gzip, decompression failure) so the corrupt file is kept for inspection.rm "${file_name_compressed}"to after the decompression validity check so the compressed file is only deleted on a fully successful run..vortex/tests/bats/unit/download-db-acquia.batscurl -s -o /dev/null -w %{redirect_url}signature and to return a plain URL string instead of a JSON body.Before / After
OLD flow
NEW flow
Summary by CodeRabbit
Bug Fixes
Tests